import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @author zyj
 * @date 2022年06月10日 9:50
 */
public class Testone {
    public static void main(String[] args) {
        A a=new A();
        FutureTask<String> task = new FutureTask<>(a);
        Thread t = new Thread(task);
        t.start();
        try {
            System.out.println(task.get());
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        }
    }
}
class A implements Callable<String> {

    @Override
    public String  call() throws Exception {
        System.out.println(Thread.currentThread().getName());
        return "null";
    }
}
